package com.runshu.newsmartark.mvp.model;

import com.runshu.newsmartark.common.ConstantUrl;
import com.runshu.newsmartark.entity.HDInfoBean;
import com.runshu.newsmartark.entity.HwInfo;
import com.runshu.newsmartark.entity.InventorySumEntity;
import com.runshu.newsmartark.entity.WeatherEntity;
import com.runshu.newsmartark.mvp.contract.MainHomeContract;
import com.runshu.newsmartark.network.netbean.HttpRequestParamsBuilder;
import com.runshu.newsmartark.network.netbean.ResponseBean;
import com.runshu.newsmartark.network.netinterface.BaseCallBack;

/**
 * Demo class
 *
 * @author yu
 * @date 2020/10/27
 * @decs：
 */

public class MainHomeModel extends BaseModel implements MainHomeContract.Model {

    @Override
    public void getIndexCount(String mac, BaseCallBack baseCallBack) {
        HttpRequestParamsBuilder builder = new HttpRequestParamsBuilder();
        builder.putParams("macAddress",mac);
        super.initDataFromServer(ConstantUrl.HW_INFO,builder.build(), HwInfo.class, ResponseBean.RES_DATATYPE_BEAN,baseCallBack);

    }

    @Override
    public void getHdInfo(String hwMac, BaseCallBack baseCallBack) {
        HttpRequestParamsBuilder builder = new HttpRequestParamsBuilder();
        builder.putParams("hwMac",hwMac);
        super.initDataFromServer(ConstantUrl.GET_HDInfo,builder.build(), HDInfoBean.class, ResponseBean.RES_DATATYPE_BEAN,baseCallBack);

    }

    @Override
    public void getInventorySum(String customerId, String hospitalId, String hwMac, BaseCallBack baseCallBack) {
        HttpRequestParamsBuilder builder = new HttpRequestParamsBuilder();
        builder.putParams("customerId",customerId);
        builder.putParams("hospitalId",hospitalId);
        builder.putParams("hwMac",hwMac);
        super.initDataFromServer(ConstantUrl.GET_inventorySum,builder.build(), InventorySumEntity.class, ResponseBean.RES_DATATYPE_BEAN,baseCallBack);

    }

}